package framework.automaton.plugin;

import framework.automaton.Logic;
import framework.automaton.State;
import framework.automaton.Updater;
import framework.grid.Grid;

/**
 * This Abstract Class clearly defines the methods that must be implemented by
 * the plugin to define how the cellular automaton will run.
 * 
 * @author Bill Ge, May Zhai, Bill Ge
 */
public abstract class AutomatonPlugin{
	
	/**
	 * Universal init method used to define the updater with the passed-in
	 * recording limit. This method is universal to all plugins.
	 * In order for the Automaton Plugin to work, this method must be called.
	 * 
	 * @param limit the number of previous Grids that can be stored
	 */
	public final Updater createUpdater(int limit){
		Updater updater = new Updater(getLogic(), getInitialGrid(), limit);
		return updater;
	}
	
	/** 
	 * @return the initial grid to be used by the program.
	 */
	abstract public Grid getInitialGrid();
	
	/** 
	 * @return the Logic object to be used within the game.
	 */
	abstract public Logic getLogic();
}